package com.spboot.mapper;

import com.alipay.api.domain.Video;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spboot.entity.Information;
import com.spboot.entity.Like;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author guocb
 * @since 2020-04-27
 */
public interface LikeMapper extends BaseMapper<Like> {
    /**
     * 添加喜欢
     * @param Informationid
     * @param userid
     * @return
     */
    int insert(Long Informationid,Long userid);


    /**
     * 删除
     * @param informationid
     * @param userid
     * @return
     */
    Long delete(Long informationid,Long userid);

    /**
     * 查询用户喜欢
     * @param userid
     * @param page
     * @param paramWrapper
     * @return
     */
    IPage<Like> likeall(Integer userid,IPage<Like> page,@Param("ew") Wrapper<Like> paramWrapper);

    /**
     * 查询用户喜欢总数
     * @param userid
     * @return
     */
    Integer sum(Integer userid);


    //添加喜欢
    /**
     * 查询颜色版本价格数据库是否有
     * @param informationid
     * @param editionid
     * @param colorid
     * @param priceid
     * @return
     */
    Integer selectsum(Long informationid,Long editionid,Long colorid,Long priceid);

    /**
     * 如果没有添加一个
     * @param informationid
     * @param editionid
     * @param colorid
     * @param priceid
     * @return
     */
    int inserttable(Long informationid,Long editionid,Long colorid,Long priceid);

    /**
     * 查询出tableid
     * @param informationid
     * @param editionid
     * @param colorid
     * @param priceid
     * @return
     */
    Integer selectid(Long informationid,Long editionid,Long colorid,Long priceid);



    int tianjia(Long informationid,Long userid,Long tableid);
}
